package com.example.jiemian;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ListView;

import com.gxyk.adapter.CommodityAdapter;

public class Shop_huadong extends  Activity {
	private ListView commodityLv;
	private CommodityAdapter adapter;
	private List<String> datas = new ArrayList<String>();
	private List<Drawable> drawables;
@Override
protected void onCreate(Bundle savedInstanceState) {
 
	super.onCreate(savedInstanceState);
	setContentView(R.layout.shangpin_activity);
	commodityLv=(ListView) findViewById(R.id.commodityLv);
	for (int i = 0; i < 30; i++) {
		datas.add(i + "");
	}
	adapter = new CommodityAdapter(this, datas);
	commodityLv.setAdapter(adapter);
	commodityLv.setSelection(Integer.MAX_VALUE / 2 + 1);
	commodityLv.setOnScrollListener(new OnScrollListener() {

		@Override
		public void onScrollStateChanged(AbsListView view, int scrollState) {
			// TODO Auto-generated method stub

		}

		@Override
		public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
			// TODO Auto-generated method stub
			adapter.setFirstVisibleItem(firstVisibleItem);
			adapter.notifyDataSetChanged();
			
		}
	});
}
}